﻿
Ext.namespace('FantastPlatform', 'FantastPlatform.UI');
FantastPlatform.UI.PersonDetailsForm = function (config) {
    Ext.apply(this, config);
    this.items = [{
        layout: 'column',
        border: false,
        labelSeparator: '：',
        items: [{
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '身份证号码',
                name: 'SFZH',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '姓名',
                name: 'XM',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '曾用名',
                name: 'CYM',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '出生日期',
                name: 'CSRQ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '性别',
                name: 'XB',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '身高',
                name: 'SG',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '民族',
                name: 'MZ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '出生地',
                name: 'CSD',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '出生地详址',
                name: 'CSDXZ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '籍贯省市县区',
                name: 'JGSSX',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '文化程度',
                name: 'WHCD',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '婚姻状况',
                name: 'HYZK',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '兵役情况',
                name: 'BYQK',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '户号',
                name: 'HH',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '与户主关系',
                name: 'YHZGX',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '住址省市县(区)',
                name: 'ZZSSXQ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '住址详址',
                name: 'ZZXZ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '何地迁入',
                name: 'HDQR',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '其他住址省市县(区)',
                name: 'QTZZSSXQ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '其他住址详址',
                name: 'QTZZXZ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '变动原因',
                name: 'BDYY',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '变动日期',
                name: 'BDRQ',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '职业',
                name: 'ZY',
                readOnly: true,
                anchor: '98%'
            })]
        }, {
            columnWidth: .5,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '服务处所',
                name: 'FWCS',
                readOnly: true,
                anchor: '98%'
            })]
        }]
        }];
   

    FantastPlatform.UI.PersonDetailsForm.superclass.constructor.call(this, {
        bodyStyle: 'padding:5px',
        collapsible: true,
        labelAlign: 'right',
        autoScroll: true,
        border: false
    });
};

Ext.extend(FantastPlatform.UI.PersonDetailsForm, Ext.form.FormPanel, {
    onRender: function (ct, position) {
        FantastPlatform.UI.PersonDetailsForm.superclass.onRender.call(this, ct, position);
        if (this.PersonCheckId && this.PersonCheckId != 0) {
            this.add(new Ext.form.Hidden({ name: 'Id', value: this.PersonCheckId }));
            this.form.load({
                timeout: 10000,
                url: '../Service/PersonSearchService.aspx?Action=GetDetails',
                params: { id: this.PersonCheckId },
                waitMsg: '正在读取数据...',
                waitTitle: '请稍后...',
                failure: function (form, action) {
                    if (action.failureType != 'client') {
                        showErrorMessage('操作失败', action.result.message, '');
                    }
                }
            });
        }
    }
});

